package com.itheima.service;

import com.itheima.mapper.UserMapper;
import com.itheima.pojo.User;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * @author Envy
 */
@Service
public class UserService {
    @Resource
    private UserMapper userMapper;

    /**
     * 查询用户是否存在
     */
    public User selectUser(String phone) {
        //根据登录手机号判断该用户是否存在
        return userMapper.selectUser(phone);
    }

    /**
     * 添加新用户到表中
     */
    public void addUser(User user){
        userMapper.addUser(user);
    }
}
